package com.freesky.web.manager.remote.panel;

import com.freesky.common.dao.entity.Panel;
import com.freesky.common.pojo.ZTreeNode;
import com.freesky.common.utils.reponse.JSONResponse;
import com.freesky.web.manager.remote.panel.fallback.HomePanelRemoteFallback;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "emall-provider-zuul", fallback = HomePanelRemoteFallback.class)
public interface HomePanelRemote {
    String ZUUL_URL_PREFIX = "/mysevice/content";
    String URL_PREFIX = "/home/panel/";

    @GetMapping(value = ZUUL_URL_PREFIX + URL_PREFIX + "/list")
    List<ZTreeNode> list();

    @PostMapping(value = ZUUL_URL_PREFIX + URL_PREFIX +"/add")
    JSONResponse add(@RequestBody Panel panel);

    @PostMapping(value = ZUUL_URL_PREFIX+URL_PREFIX + "/update")
    JSONResponse update(@RequestBody Panel panel);

    @DeleteMapping(value = ZUUL_URL_PREFIX+URL_PREFIX + "/del/{id}")
     JSONResponse delete(@PathVariable(value = "id") int id);
}
